package com.niiwoo.civet.trade.dao.mapper;

import com.niiwoo.civet.trade.dao.entity.UserInvestConfig;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserInvestConfigMapperExt extends UserInvestConfigMapper {

    UserInvestConfig queryByUserId(@Param("userId") String userId, @Param("investWay") Byte investWay);

    int updateByUserId(UserInvestConfig config);

    int deleteByUserId(@Param("userId") String userId, @Param("investWay") Byte investWay);

    int deleteAllByInvestWay(@Param("investWay") Byte investWay);

    List<UserInvestConfig> queryAllUserInvestConfig(@Param("investWay") Byte investWay);

    UserInvestConfig selectByPrimaryKeyForUpdate(@Param("id") Long id);
    /**
     * 关闭自动投资
     * @return
     */
	int  systemCloseAutoInvest();
	/**
	 * 关闭批量投资
	 * @return
	 */
	int  systemCloseBatchInvest();

	int disableInvest();
	/**
	 * 关闭单人的自动投资配置
	 * @param userId
	 */
	void disableAutoInvestBySystemUserId(String userId);

}